#pragma once
#include <iostream>
#include "util.hpp"
using namespace ns_util;
namespace ns_Log
{
    enum
    {
        Info,
        Debug,
        Warning,
        Error,
        Fatal
    };

    class Log
    {
    public:
        Log() {}
        ~Log() {}
        static inline std::ostream &logMessage(const std::string &level, const std::string &file_name, int line)
        {
            std::string message;
            // 添加日志等级
            message += "[";
            message += level;
            message += "]";

            // 添加文件名
            message += "[";
            message += file_name;
            message += "]";

            // 添加文件行
            message += "[";
            message += std::to_string(line);
            message += "]";

            //添加日志时间
            message += "[";
            message += Timeutil::GetTimeStamp();
            message += "]";

            std::cout << message;
            return std::cout;
        }
    };
    //开放式日志
    #define LOG(level) Log::logMessage(#level,__FILE__,__LINE__)
}

